﻿using System.Collections;
using System.Collections.Generic;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;

public class ChoosePlayerUI : MonoBehaviour
{    
    [SerializeField] TMPro.TMP_Text readyText;
    [SerializeField] TMPro.TMP_Text nameText;    

    public bool IsReady { get; private set; } = false;
    
    public void OnReadyBTClick()
    {
        IsReady = !IsReady;
        readyText.text = IsReady ? "已准备" : "未准备";
    }

    public void SetData(string name,ulong id)
    {
        nameText.text= name;
        if (id == NetworkManager.ServerClientId)
        {
            IsReady = true;
            readyText.text = "房主";
        }
        else
        {
            IsReady = false;
            readyText.text = "未准备";
        }            
    }
}
